<app-editor [(ngModel)]="data" (ngModelChange)="basicForm.patchValue($event)" [submitting]="submitting" (submit)="submit()">

  <nz-collapse [formGroup]="basicForm" (change)="change()">
    <nz-collapse-panel nzHeader="基本信息" nzActive>
      <nz-form-item>
        <nz-form-label [nzSpan]="5">名称</nz-form-label>
        <nz-form-control [nzSpan]="12" nzErrorTip="">
          <input nz-input formControlName="name" required/>
        </nz-form-control>
      </nz-form-item>

      <nz-form-item>
        <nz-form-label [nzSpan]="5">类型</nz-form-label>
        <nz-form-control [nzSpan]="12" nzErrorTip="">
          <nz-select formControlName="type" (ngModelChange)="change()" (change)="change()">
            <nz-option nzValue="tcp" nzLabel="TCP服务器"></nz-option>
            <nz-option nzValue="udp" nzLabel="UDP服务器"></nz-option>
          </nz-select>
        </nz-form-control>
      </nz-form-item>

      <nz-form-item>
        <nz-form-label [nzSpan]="5">地址</nz-form-label>
        <nz-form-control [nzSpan]="12" nzErrorTip="">
          <input nz-input formControlName="addr" placeholder="端口号" required/>
        </nz-form-control>
      </nz-form-item>

      <nz-form-item>
        <nz-form-label [nzSpan]="5">禁用</nz-form-label>
        <nz-form-control [nzSpan]="12" nzErrorTip="">
          <nz-switch formControlName="disabled"></nz-switch>
        </nz-form-control>
      </nz-form-item>

    </nz-collapse-panel>


    <nz-collapse-panel nzHeader="注册包" nzActive>
      <app-edit-register formControlName="register"></app-edit-register>
    </nz-collapse-panel>

    <nz-collapse-panel nzHeader="协议适配" nzActive>
      <app-edit-protocol formControlName="protocol"></app-edit-protocol>
    </nz-collapse-panel>

    <nz-collapse-panel nzHeader="默认设备" nzActive>
      <app-server-edit-devices formControlName="devices"></app-server-edit-devices>
    </nz-collapse-panel>

  </nz-collapse>


</app-editor>
